package com.dayuanit.dy17.mix.current;

import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;

public class TestCopyWtriteArrayList {
    public static void main(String[] args) {
        //线程安全的ArrayList集合

        Vector vector = new Vector();
        vector.add("tom");


        CopyOnWriteArrayList copyWtriteArrayList = new CopyOnWriteArrayList<>();
        copyWtriteArrayList.add("tom");
        copyWtriteArrayList.add("jack");
        copyWtriteArrayList.add("bob");

        System.out.println(copyWtriteArrayList.get(2));

    }
}
